import {Form, Button, Row, Col, DatePicker  } from 'antd';
import { campanys } from '../../utils/config';
import moment from 'moment';
const { RangePicker } = DatePicker;
const FormItem = Form.Item;

function query({form, onOk }){

  const {getFieldDecorator,getFieldsValue,resetFields} = form;
  const formItemLayout = {
    // labelCol: { span: 7 },
    wrapperCol: { span: 20 },
    colon:false,
  };
  const submit = () => {
    const values = getFieldsValue();
    onOk(values);

  };

  return(
    <Form
      onSubmit={submit}
    >
      <Row>
        <Col span={12}>
          <FormItem
          wrapperCol= {{ span: 22 }}
          colon={false}
          >
            {
              getFieldDecorator('timeSpan',{
              })(<RangePicker format={'YYYY-MM-DD'} size='large' placeholder={['起始时间','结束时间']} style={{width:'100%'}}/>)
            }
          </FormItem>
        </Col>

        <Col span={12}
          // style={{ textAlign: 'right'}}
        >
          <Button type='primary' size='large' icon='search' onClick={submit} style={{ marginRight: 20}}>查看</Button>
        </Col>
      </Row>
    </Form>
  )
}

export default Form.create()(query);
